#!/bin/bash
#
# Copyright (c) 2011 Volodymyr M. Lisivka <vlisivka@gmail.com>, All Rights Reserved
#
# This file is part of bash-modules (http://trac.assembla.com/bash-modules/).
#
# bash-modules is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License, or
# (at your option) any later version.
#
# bash-modules is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with bash-modules  If not, see <http://www.gnu.org/licenses/>.


[ "${__xterm_keyboard_input_tokenizer__DEFINED:-}" == "yes" ] || {
  __xterm_keyboard_input_tokenizer__DEFINED="yes"

  . import.sh log arguments

  xterm_keyboard_input_tokenizer_summary() {
    echo "Translate escape sequences, like \"\e[A\", into key names, like \"up\". For xterm and compatible terminals only."
  }

  xterm_keyboard_input_tokenizer_usage() {
    echo '
    xterm_keyboard_input_tokenizer

        Read key sequences from STDIN and print corresponding key names
        to STDOUT. Key names can be prefixed with alt_, ctrl_ or shift_ prefixes
        in that order, e.g. \"alt_ctrl_shift_f1\".

        If no keys are pressed for more than one second, then print
        \"TIMEOUT\" string.

        If input is closed, then print \"EOF\" string.

'
  }

xterm_keyboard_input_tokenizer() {
while true
do

# Generated by bash-modules/keyboard_input_tokenizer.sh written by Volodymyr M. Lisivka <vlisivka@gmail.com>

IFS=""
TOKENIZER_KEY_SEQUENCE=""
    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
    case "$TOKENIZER_KEY" in
      $'\n')
        echo newline || break
      ;;
      $'\001')
        echo ctrl_a || break
      ;;
      $'\002')
        echo ctrl_b || break
      ;;
      $'\003')
        echo ctrl_c || break
      ;;
      $'\004')
        echo ctrl_d || break
      ;;
      $'\005')
        echo ctrl_e || break
      ;;
      $'\006')
        echo ctrl_f || break
      ;;
      $'\007')
        echo ctrl_g || break
      ;;
      $'\x7f'|$'\cH')
        echo backspace || break
      ;;
      $'\t')
        echo tab || break
      ;;
      $'\013')
        echo ctrl_k || break
      ;;
      $'\014')
        echo ctrl_l || break
      ;;
      $'\r')
        echo carriagereturn || break
      ;;
      $'\016')
        echo ctrl_n || break
      ;;
      $'\017')
        echo ctrl_o || break
      ;;
      $'\020')
        echo ctrl_p || break
      ;;
      $'\021')
        echo ctrl_q || break
      ;;
      $'\022')
        echo ctrl_r || break
      ;;
      $'\023')
        echo ctrl_s || break
      ;;
      $'\024')
        echo ctrl_t || break
      ;;
      $'\025')
        echo ctrl_u || break
      ;;
      $'\026')
        echo ctrl_v || break
      ;;
      $'\027')
        echo ctrl_w || break
      ;;
      $'\030')
        echo ctrl_x || break
      ;;
      $'\031')
        echo ctrl_y || break
      ;;
      $'\032')
        echo ctrl_z || break
      ;;
      $'\e')
        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
        case "$TOKENIZER_KEY" in
          $'\n')
            echo alt_newline || break
          ;;
          $'\001')
            echo alt_ctrl_a || break
          ;;
          $'\002')
            echo alt_ctrl_b || break
          ;;
          $'\003')
            echo alt_ctrl_c || break
          ;;
          $'\004')
            echo alt_ctrl_d || break
          ;;
          $'\005')
            echo alt_ctrl_e || break
          ;;
          $'\006')
            echo alt_ctrl_f || break
          ;;
          $'\007')
            echo alt_ctrl_g || break
          ;;
          $'\x7f'|$'\cH')
            echo alt_backspace || break
          ;;
          $'\t')
            echo alt_tab || break
          ;;
          $'\013')
            echo alt_ctrl_k || break
          ;;
          $'\014')
            echo alt_ctrl_l || break
          ;;
          $'\r')
            echo alt_carriagereturn || break
          ;;
          $'\016')
            echo alt_ctrl_n || break
          ;;
          $'\017')
            echo alt_ctrl_o || break
          ;;
          $'\020')
            echo alt_ctrl_p || break
          ;;
          $'\021')
            echo alt_ctrl_q || break
          ;;
          $'\022')
            echo alt_ctrl_r || break
          ;;
          $'\023')
            echo alt_ctrl_s || break
          ;;
          $'\024')
            echo alt_ctrl_t || break
          ;;
          $'\025')
            echo alt_ctrl_u || break
          ;;
          $'\026')
            echo alt_ctrl_v || break
          ;;
          $'\027')
            echo alt_ctrl_w || break
          ;;
          $'\030')
            echo alt_ctrl_x || break
          ;;
          $'\031')
            echo alt_ctrl_y || break
          ;;
          $'\032')
            echo alt_ctrl_z || break
          ;;
          $'\e')
            echo alt_escape || break
          ;;
          $'\034')
            echo alt_ctrl_backslash || break
          ;;
          $'\035')
            echo alt_ctrl_rightbracket || break
          ;;
          $'\036')
            echo alt_ctrl_circumflex || break
          ;;
          $'\037')
            echo alt_ctrl_underscore || break
          ;;
          'O')
            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
            case "$TOKENIZER_KEY" in
              '1')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '2')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'P')
                            echo shift_f1 || break
                          ;;
                          'Q')
                            echo shift_f2 || break
                          ;;
                          'R')
                            echo shift_f3 || break
                          ;;
                          'S')
                            echo shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'P')
                            echo alt_f1 || break
                          ;;
                          'Q')
                            echo alt_f2 || break
                          ;;
                          'R')
                            echo alt_f3 || break
                          ;;
                          'S')
                            echo alt_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '4')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'P')
                            echo alt_shift_f1 || break
                          ;;
                          'Q')
                            echo alt_shift_f2 || break
                          ;;
                          'R')
                            echo alt_shift_f3 || break
                          ;;
                          'S')
                            echo alt_shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'P')
                            echo ctrl_f1 || break
                          ;;
                          'Q')
                            echo ctrl_f2 || break
                          ;;
                          'R')
                            echo ctrl_f3 || break
                          ;;
                          'S')
                            echo ctrl_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '6')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'P')
                            echo ctrl_shift_f1 || break
                          ;;
                          'Q')
                            echo ctrl_shift_f2 || break
                          ;;
                          'R')
                            echo ctrl_shift_f3 || break
                          ;;
                          'S')
                            echo ctrl_shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              'F')
                echo end || break
              ;;
              'H')
                echo home || break
              ;;
              'P')
                echo f1 || break
              ;;
              'Q')
                echo f2 || break
              ;;
              'R')
                echo f3 || break
              ;;
              'S')
                echo f4 || break
              ;;
              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
            esac
          ;;
          '[')
            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
            case "$TOKENIZER_KEY" in
              '1')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  '5')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f5 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f5 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f5 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f5 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f5 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f5 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '7')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f6 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f6 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f6 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f6 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f6 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f6 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '8')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f7 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f7 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f7 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f7 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f7 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f7 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '9')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f8 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f8 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f8 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f8 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f8 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f8 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '2')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'A')
                            echo shift_up || break
                          ;;
                          'B')
                            echo shift_down || break
                          ;;
                          'C')
                            echo shift_right || break
                          ;;
                          'D')
                            echo shift_left || break
                          ;;
                          'F')
                            echo shift_end || break
                          ;;
                          'H')
                            echo shift_home || break
                          ;;
                          'P')
                            echo shift_f1 || break
                          ;;
                          'Q')
                            echo shift_f2 || break
                          ;;
                          'R')
                            echo shift_f3 || break
                          ;;
                          'S')
                            echo shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'A')
                            echo alt_up || break
                          ;;
                          'B')
                            echo alt_down || break
                          ;;
                          'C')
                            echo alt_right || break
                          ;;
                          'D')
                            echo alt_left || break
                          ;;
                          'E')
                            echo alt_keypad5 || break
                          ;;
                          'F')
                            echo alt_end || break
                          ;;
                          'H')
                            echo alt_home || break
                          ;;
                          'P')
                            echo alt_f1 || break
                          ;;
                          'Q')
                            echo alt_f2 || break
                          ;;
                          'R')
                            echo alt_f3 || break
                          ;;
                          'S')
                            echo alt_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '4')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'A')
                            echo alt_shift_up || break
                          ;;
                          'B')
                            echo alt_shift_down || break
                          ;;
                          'C')
                            echo alt_shift_right || break
                          ;;
                          'D')
                            echo alt_shift_left || break
                          ;;
                          'F')
                            echo alt_shift_end || break
                          ;;
                          'H')
                            echo alt_shift_home || break
                          ;;
                          'P')
                            echo alt_shift_f1 || break
                          ;;
                          'Q')
                            echo alt_shift_f2 || break
                          ;;
                          'R')
                            echo alt_shift_f3 || break
                          ;;
                          'S')
                            echo alt_shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'A')
                            echo ctrl_up || break
                          ;;
                          'B')
                            echo ctrl_down || break
                          ;;
                          'C')
                            echo ctrl_right || break
                          ;;
                          'D')
                            echo ctrl_left || break
                          ;;
                          'E')
                            echo ctrl_keypad5 || break
                          ;;
                          'F')
                            echo ctrl_end || break
                          ;;
                          'H')
                            echo ctrl_home || break
                          ;;
                          'P')
                            echo ctrl_f1 || break
                          ;;
                          'Q')
                            echo ctrl_f2 || break
                          ;;
                          'R')
                            echo ctrl_f3 || break
                          ;;
                          'S')
                            echo ctrl_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '6')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'C')
                            echo ctrl_shift_right || break
                          ;;
                          'D')
                            echo ctrl_shift_left || break
                          ;;
                          'F')
                            echo ctrl_shift_end || break
                          ;;
                          'H')
                            echo ctrl_shift_home || break
                          ;;
                          'P')
                            echo ctrl_shift_f1 || break
                          ;;
                          'Q')
                            echo ctrl_shift_f2 || break
                          ;;
                          'R')
                            echo ctrl_shift_f3 || break
                          ;;
                          'S')
                            echo ctrl_shift_f4 || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '7')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'E')
                            echo alt_ctrl_keypad5 || break
                          ;;
                          'F')
                            echo alt_ctrl_end || break
                          ;;
                          'H')
                            echo alt_ctrl_home || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '8')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          'C')
                            echo alt_ctrl_shift_right || break
                          ;;
                          'D')
                            echo alt_ctrl_shift_left || break
                          ;;
                          'F')
                            echo alt_ctrl_shift_end || break
                          ;;
                          'H')
                            echo alt_ctrl_shift_home || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              '2')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  '0')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f9 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f9 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f9 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f9 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f9 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f9 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '1')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f10 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f10 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f10 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f10 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f10 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f10 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '3')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f11 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f11 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f11 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f11 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f11 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f11 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '4')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      ';')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '2')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo shift_f12 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '3')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_f12 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '4')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo alt_shift_f12 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '5')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_f12 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          '6')
                            read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                            TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                            case "$TOKENIZER_KEY" in
                              '~')
                                echo ctrl_shift_f12 || break
                              ;;
                              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                            esac
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '~')
                        echo f12 || break
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_insert || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo ctrl_insert || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '7')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_ctrl_insert || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '~')
                    echo insert || break
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              '3')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '2')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo shift_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '4')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_shift_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo ctrl_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '6')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo ctrl_shift_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '8')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_ctrl_shift_delete || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '~')
                    echo delete || break
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              '5')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_pageup || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo ctrl_pageup || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '7')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_ctrl_pageup || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '~')
                    echo pageup || break
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              '6')
                read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                case "$TOKENIZER_KEY" in
                  ';')
                    read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                    TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                    case "$TOKENIZER_KEY" in
                      '3')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_pagedown || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '5')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo ctrl_pagedown || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      '7')
                        read -t 1 -s -r -N 1 TOKENIZER_KEY || { if [ $? -gt 128 ]; then echo "TIMEOUT" || break ; continue ; else echo "EOF" ; break ; fi ; }
                        TOKENIZER_KEY_SEQUENCE="$TOKENIZER_KEY_SEQUENCE$TOKENIZER_KEY"
                        case "$TOKENIZER_KEY" in
                          '~')
                            echo alt_ctrl_pagedown || break
                          ;;
                          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                        esac
                      ;;
                      *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                    esac
                  ;;
                  '~')
                    echo pagedown || break
                  ;;
                  *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
                esac
              ;;
              'A')
                echo up || break
              ;;
              'B')
                echo down || break
              ;;
              'C')
                echo right || break
              ;;
              'D')
                echo left || break
              ;;
              'E')
                echo keypad5 || break
              ;;
              'F')
                echo end || break
              ;;
              'H')
                echo home || break
              ;;
              'Z')
                echo shift_tab || break
              ;;
              *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
            esac
          ;;
          *) echo "alt_${TOKENIZER_KEY_SEQUENCE#?}"  || break ;;
        esac
      ;;
      $'\034')
        echo ctrl_backslash || break
      ;;
      $'\035')
        echo ctrl_rightbracket || break
      ;;
      $'\036')
        echo ctrl_circumflex || break
      ;;
      $'\037')
        echo ctrl_underscore || break
      ;;
      *) echo "$TOKENIZER_KEY"  || break ;;
    esac
done
}
}
